Skip to content

ci: lower mmap_rnd_bits for address and thread sanitizer jobs - #957

Merged
viferga merged 2 commits into
metacall:developfrom
bhuvan-somisetty:ci/sanitizer-mmap-rnd-bits
Nov 12, 2026
Merged

viferga merged 2 commits into
metacall:developfrom
bhuvan-somisetty:ci/sanitizer-mmap-rnd-bits

Conversation

@bhuvan-somisetty

@bhuvan-somisetty bhuvan-somisetty commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Motive

The thread sanitizer jobs started failing on every test with "unexpected memory mapping". ubuntu-latest moved to ubuntu-26.04, and the newer kernel uses more mmap random bits than the sanitizers support. The last green run was still on 24.04.

Approach

vm.mmap_rnd_bits is a host kernel setting, and docker containers share the host kernel and can not write /proc/sys, so it can not go in metacall-environment.sh. This adds a step that runs sudo sysctl vm.mmap_rnd_bits=28 on the runner before ./docker-compose.sh:

  • linux-sanitizer-test: always, since every entry is address or thread sanitizer
  • linux-clang-test: only for clang-address-sanitizer and clang-thread-sanitizer (named explicitly in the if)

The memory sanitizer and valgrind jobs are unchanged. Scope agreed with @viferga on Discord: only when running with thread or address sanitizer.

Tests

Can not be run locally, the CI run on this PR is the test. The thread and address sanitizer jobs should get past startup again.

AI-ASSISTED: yes, model: Claude Opus 5.5, human reviewer: bhuvan-somisetty

ubuntu-latest moved to ubuntu-26.04, and its kernel uses more mmap
random bits than the sanitizers support, so every thread sanitizer test
dies at startup with "unexpected memory mapping". The setting belongs to
the host kernel and docker containers can not change it, so set
vm.mmap_rnd_bits=28 on the runner before the tests start. Only the GCC
sanitizer jobs and the clang address and thread sanitizer jobs get it.
@bhuvan-somisetty bhuvan-somisetty changed the title ci: lower mmap_rnd_bits for address and thread sanitizer jobs ci: lower mmap_rnd_bits for address and thread sanitizer jobs Nov 11, 2026
Check for the address and thread sanitizer entries explicitly, so a new
entry added to the clang matrix does not get the sysctl by accident.
@viferga
viferga merged commit ce8b87b into metacall:develop Nov 12, 2026
85 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants